package com.yunzhi.medical.controller;

import com.yunzhi.medical.pojo.CheckItem;
import com.yunzhi.medical.CheckItemService;
import com.yunzhi.medical.utils.PageResult;
import com.yunzhi.medical.utils.QueryPageBean;
import com.yunzhi.medical.utils.Result;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :Mikey
 * @description :
 * @create :2022-06-25 10:58:00
 */
@RestController
@RequestMapping("/checkItem")
public class CheckItemController {
    @Reference
    private CheckItemService checkItemService;
    @RequestMapping("/addCheckItem")
    public Result checkItemInfo(@RequestBody CheckItem checkItem){
        Result result = checkItemService.addCheckItemInfo(checkItem);
        return result;
    }
    @RequestMapping("/findItemInfo")
    public PageResult findCkeckItemInfo(@RequestBody QueryPageBean queryPageBean){
        return checkItemService.findPageInfo(queryPageBean);
    }
//    @RequestMapping("/findCkeckItem")
//    public Result findCkeckItem(Integer id){
//        return checkItemService.findCkeckItem(id);
//    }
    @RequestMapping("/updateItem")
    public Result updateCheckItem(@RequestBody CheckItem checkItem){
        return checkItemService.updateCheckItem(checkItem);
    }
    @RequestMapping("/deleteItem")
    public Result deleteCheckItem(@RequestParam Integer id){
        return checkItemService.deleteCheckItem(id);
    }
}
